package com.tyson.learn.io;

import java.io.*;

public class FileTest {
    public static void main(String[] args) throws IOException {
        File file = new File("E:\\java\\learn\\MyLearn\\src\\com\\tyson\\learn\\io\\test.txt");
        if (file.exists()) {
            InputStream inputStream = new FileInputStream(file);
//            System.out.println(inputStream.read());
//            System.out.println(inputStream.read());
//            System.out.println(inputStream.read());
//            System.out.println(inputStream.read());
//            System.out.println(inputStream.read());
//            System.out.println(inputStream.read());
//            System.out.println(inputStream.read());
//            System.out.println(inputStream.read());


//            for (int i = 0; i <file.length() ; i++) {
//                System.out.println(inputStream.read());
//            }
            int temp = 0;
            while ((temp = inputStream.read()) != -1) {
                System.out.println(temp);
            }
        }


    }
}
